﻿
using FreeSql.DataAnnotations;

namespace System.AuthCenter.DBModels
{
    /// <summary>
    /// 用户登陆信息表
    /// </summary>
    [Table(Name = "UserLoginInfos")]
    public class UserLoginInfos
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        [Column(IsPrimary = true)]
        public long UID { get; set; } = LuanNiao.Core.IDGen.GetInstance().NextId();
        /// <summary>
        /// 类型
        /// </summary>
        public int Type { get; set; }
        /// <summary>
        /// OpenKey
        /// </summary>
        public string OpenKey { get; set; } = "";
        /// <summary>
        /// OpenID
        /// </summary>
        public string OpenID { get; set; } = "";
        /// <summary>
        /// Token
        /// </summary>
        public string Token { get; set; } = "";
        /// <summary>
        /// 刷新密钥
        /// </summary>
        public string RefreshToken { get; set; } = "";
        /// <summary>
        /// 唯一ID
        /// </summary>
        public string UnionID { get; set; } = "";

        public DateTime Created { get; set; } = DateTime.Now;
        public long CreatedBy { get; set; }
        public DateTime Modified { get; set; } = DateTime.Now;
        public long ModifiedBy { get; set; }

        [Navigate(nameof(UID))]
        public List<UserRoles> UserRoles { get; set; } = new();
        [Navigate(nameof(UID))]
        public List<UserScopes> UserScopes { get; set; } = new();

    }
}
